class MatchSearchEntity {
  int? sportsId;
  int? matchId;
  String? matchTime;
  String? leagueName;
  String? homeName;
  String? awayName;
  int? status;
  String? homeScore;
  String? awayScore;

  MatchSearchEntity(
      {this.sportsId,
        this.matchId,
        this.matchTime,
        this.leagueName,
        this.homeName,
        this.awayName,
        this.status,
        this.homeScore,
        this.awayScore});

  MatchSearchEntity.fromJson(Map<String, dynamic> json) {
    sportsId = json['sportsId'];
    matchId = json['matchId'];
    matchTime = json['matchTime'];
    leagueName = json['leagueName'];
    homeName = json['homeName'];
    awayName = json['awayName'];
    status = json['status'];
    homeScore = json['homeScore'];
    awayScore = json['awayScore'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['sportsId'] = this.sportsId;
    data['matchId'] = this.matchId;
    data['matchTime'] = this.matchTime;
    data['leagueName'] = this.leagueName;
    data['homeName'] = this.homeName;
    data['awayName'] = this.awayName;
    data['status'] = this.status;
    data['homeScore'] = this.homeScore;
    data['awayScore'] = this.awayScore;
    return data;
  }
}

class MatchSearchItem {
  int? sportsId;
  int? matchId;
  String? matchInfo;

  MatchSearchItem(
      {this.sportsId,
        this.matchId,
        this.matchInfo});

  MatchSearchItem.fromJson(Map<String, dynamic> json) {
    sportsId = json['sportsId'];
    matchId = json['matchId'];
    List<String> text = [json['homeName'] ?? ""," vs ",json['awayName'] ?? ""];
    if(json['homeScore'] != null && json['awayScore'] != null){
      text[1] = " ${json['homeScore']}:${json['awayScore']} ";
    }
    matchInfo = text.join();
  }

}